<#assign t=JspTaglibs["/META-INF/tld/tiles-jsp.tld"] />
<#assign s=JspTaglibs["/META-INF/tld/struts-tags.tld"] />
<@s.url value="" var="cntxpth"/>
<@s.set name="contextPath" value="#cntxpth"  />
<@s.set name="templateName" value="#templateName"/>
<@s.set name="resourcePath">/${contextPath}templates/${templateName}</@s.set>
<table width="100%">
    <tr>
        <td>
            <div id="form" class="grid_4">
                <h2>User information</h2>
                <fieldset>
                    <label>
                        Name: <@s.property value="%{user.name}" />
                    </label>
                    <label>
                        Nick name: <@s.property value="user.nickName"/>
                    </label>
                </fieldset>
            </div>
        </td>
        <td>
            <h2>User roles</h2>
            <table width="100%">
                <thead>
                <tr>
                    <td>Role name</td>
                    <td>Role permission</td>
                </tr>
                </thead>
            <@s.iterator  value="roles">
                <tr>
                    <td><@s.property value="name" /></td>
                    <td><@s.property value="permission" /></td>
                </tr>
            </@s.iterator>
                <tr>
                    <td colspan="2">
                    <@s.url namespace="/profile" action="reassignUserRoles" var="reassignUserRoles">
                        <@s.param name="user.id" value="user.id" />
                    </@s.url>
                        <@s.a href="${reassignUserRoles}">reassign roles for user</@s.a>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            <h2>User groups</h2>
            <table width="100%">
                <thead>
                <tr>
                    <td>Group name</td>
                    <td>Group permission</td>
                </tr>
                </thead>
            <@s.iterator  value="groups">
                <tr>
                    <td><@s.property value="name" /></td>
                    <td><@s.property value="permission" /></td>
                </tr>
            </@s.iterator>
                <tr>
                    <td colspan="2">
                        <@s.url namespace="/profile" action="reassignUserGroups" var="reassignUserGroups">
                            <@s.param name="user.id" value="user.id" />
                        </@s.url>
                        <@s.a href="${reassignUserGroups}">reassign groups for user</@s.a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>


<div class="clear"></div>